<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
            let newArr = new Array();
            for( let i = 0;i < 5; i++){
                let age = prompt();
                age = Number(age);
                if(age>=0 && age<=100){
                    newArr.push(age);
                }
            }
            let sum = 0;
            for(let i = 0;i < newArr.length;i++){
                sum += newArr[i];
            }
            let adults = new Array();
            for(let i = 0;i < newArr.length;i++){
                if(newArr[i] >=18)
                adults.push(newArr[i]);
            }
            let ave = 0;
            for(let i = 0;i < newArr.length;i++){
                ave += newArr[i];12
            }
            ave /= newArr.length;
            let min = max = newArr[0];
            for(let i = 0;i < newArr.length;i++){
                if(newArr[i] > max){
                    max = newArr[i];
                }
                if(newArr[i] < min){
                    min = newArr[i];
                }
            }
            console.log('成年人:'+adults);
            console.log('总年龄：'+sum);
            console.log('平均年龄：'+ave);
            console.log('最小值：'+ min);
            console.log('最大值：'+ max);
    </script>
</body>
</html>
